package io.renren.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import cn.hutool.core.util.StrUtil;
import io.renren.common.service.impl.CrudServiceImpl;
import io.renren.dao.RepairquotationpickingdDao;
import io.renren.dto.RepairquotationpickingdDTO;
import io.renren.entity.RepairquotationpickingdEntity;
import io.renren.service.RepairquotationpickingdService;
import org.springframework.stereotype.Service;

import java.util.Collections;
import java.util.List;
import java.util.Map;

/**
 * ${comments}
 *
 * @author Sen 524227263@qq.com
 * @since 1.0.0 2024-05-28
 */
@Service
public class RepairquotationpickingdServiceImpl extends CrudServiceImpl<RepairquotationpickingdDao, RepairquotationpickingdEntity, RepairquotationpickingdDTO> implements RepairquotationpickingdService {

    @Override
    public QueryWrapper<RepairquotationpickingdEntity> getWrapper(Map<String, Object> params) {
        String id = (String) params.get("id");

        QueryWrapper<RepairquotationpickingdEntity> wrapper = new QueryWrapper<>();
        wrapper.eq(StrUtil.isNotBlank(id), "id", id);

        return wrapper;
    }


    @Override
    public List<RepairquotationpickingdEntity> getListByRepairQuotationMFk(String repairquotationmoid) {

        QueryWrapper<RepairquotationpickingdEntity> wrapper = new QueryWrapper<>();
        wrapper.select("GoodsName,BusinessQuantity,Amount,price,BusinessAmount,BusinessUnit");
        wrapper.eq("RepairQuotationM_FK", repairquotationmoid);
        List<RepairquotationpickingdEntity> list = baseDao.selectList(wrapper);
        return list;
    }
}